<template>
  <div class="home">
    <head-nav
      :province='province'
      setCurrYear='setCurrYear'
    ></head-nav>
    <div class="china-province-box">
      <china-map @setCurrProvince='setCurrProvince'></china-map>
      <scene-monitoring></scene-monitoring>
    </div>
    <div class="china-province-box">
      <project-type-pie class="chart-box-item"></project-type-pie>
      <project-cost-pie class="chart-box-item"></project-cost-pie>
    </div>
    <div class="china-province-box">
      <project-num-money class="chart-box-item"></project-num-money>
      <carry-prize-num-type class="chart-box-item"></carry-prize-num-type>
    </div>
    <div class="china-province-box year-project-data">
      <project-bar-data class="chart-box-item"></project-bar-data>
    </div>
  </div>
</template>

<script>
import HeadNav from "@/components/HeadNav";
import ChinaMap from "@/components/ChinaMap";
import SceneMonitoring from "@/components/SceneMonitoring";
import ProjectTypePie from "@/components/ProjectTypePie";
import ProjectCostPie from "@/components/ProjectCostPie";
import ProjectNumMoney from "@/components/ProjectNumMoney";
import CarryPrizeNumType from "@/components/CarryPrizeNumType";
import ProjectBarData from "@/components/ProjectBarData";

export default {
  name: "Home",
  components: {
    HeadNav,
    ChinaMap,
    SceneMonitoring,
    ProjectTypePie,
    ProjectCostPie,
    ProjectNumMoney,
    CarryPrizeNumType,
    ProjectBarData,
  },
  data() {
    return {
      province: "全国", // 当前区域
      year: new Date(), // 当前年
    };
  },
  created() {},
  methods: {
    //  设置当前省份
    setCurrProvince(province) {
      this.province = province;
    },
    // 设置当前年
    setCurrYear(year) {
      this.year = year;
    },
  },
};
</script>
<style lang="less" scoped>
@import "../common/css/common";
.home {
  width: 100%;
  height: auto;
  box-sizing: border-box;
  margin: 0 auto;
  padding-bottom: 100px;
  background: #f7f9fc;
}
.china-province-box {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  padding: 0 54px;
  box-sizing: border-box;
  margin-top: 20px;
}
.china-province-box:last-child {
  margin-bottom: 20px;
}
.chart-box-item {
  width: 48%;
}
.year-project-data.china-province-box {
  .chart-box-item {
    width: 100%;
  }
}
</style>
